package com.graduate.front.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.graduate.common.entity.House;
import com.graduate.common.entity.Result;
import com.graduate.common.service.IHouseService;
import com.graduate.common.vo.HouseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author bwzfy
 * @create 2021/5/10
 **/
@RestController
@RequestMapping("/house")
public class HouseController extends BaseController {


    /**
     * 分页展示所有的房间信息
     * @return
     */
    @GetMapping("/list")
    public Result<IPage<HouseVo>> houseList(@RequestParam(required = false) Map<String, Object> map) {
        Result<IPage<HouseVo>> result = new Result<>();
        result.setCode(200);
        result.setData(houseService.selectHousePage(map));
        return result;
    }

}
